import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import user from "@/store/modules/user";
import order from "@/store/modules/order";
import permission from "@/store/modules/permission";
import vip from "@/store/modules/vip"
import shopOperation from "@/store/modules/shopOperation";
// import createPersistedState from 'vuex-persistedstate';
Vue.use(Vuex);

const modules = {
  vip, user, permission, order,shopOperation
};
const store = new Vuex.Store({
  modules,
  getters,
  // plugins: [createPersistedState({
  //   reducer(val) {
  //     return {
  //       // 只储存state中的router_id and routes
  //       router_id:val.user.router_id,
  //       routes: val.permission.routes
  //     }
  //   }
  // })],
});
window.store = store;
export default store
